Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-27203 Clean up error-prone findings in hbase-client #4626

Closed
wants to merge 1 commit into from

Conversation

apurtell
Copy link
Contributor

No description provided.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 19s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 51s master passed
+1 💚 compile 0m 20s master passed
+1 💚 shadedjars 3m 49s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 19s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 40s the patch passed
+1 💚 compile 0m 19s the patch passed
+1 💚 javac 0m 19s the patch passed
+1 💚 shadedjars 3m 41s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 18s hbase-client generated 0 new + 46 unchanged - 9 fixed = 46 total (was 55)
_ Other Tests _
+1 💚 unit 1m 17s hbase-client in the patch passed.
18m 23s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #4626
Optional Tests javac javadoc unit shadedjars compile
uname Linux 8a578f4af13f 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 01b45e2
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/testReport/
Max. process+thread count 190 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 55s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 57s master passed
+1 💚 compile 0m 19s master passed
+1 💚 shadedjars 4m 51s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 22s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 52s the patch passed
+1 💚 compile 0m 21s the patch passed
+1 💚 javac 0m 21s the patch passed
+1 💚 shadedjars 4m 43s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 17s the patch passed
_ Other Tests _
+1 💚 unit 1m 25s hbase-client in the patch passed.
20m 26s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #4626
Optional Tests javac javadoc unit shadedjars compile
uname Linux e9b5ade1fbb1 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 01b45e2
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/testReport/
Max. process+thread count 164 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 26s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 3m 8s master passed
+1 💚 compile 0m 51s master passed
+1 💚 checkstyle 0m 18s master passed
+1 💚 spotless 0m 56s branch has no errors when running spotless:check.
+1 💚 spotbugs 0m 58s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 41s the patch passed
+1 💚 compile 0m 39s the patch passed
+1 💚 javac 0m 39s hbase-client generated 0 new + 0 unchanged - 123 fixed = 0 total (was 123)
-0 ⚠️ checkstyle 0m 16s hbase-client: The patch generated 1 new + 163 unchanged - 64 fixed = 164 total (was 227)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 13m 14s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 spotless 0m 48s patch has no errors when running spotless:check.
+1 💚 spotbugs 0m 51s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 9s The patch does not generate ASF License warnings.
32m 18s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #4626
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux cbee69a2ab0c 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 01b45e2
Default Java AdoptOpenJDK-1.8.0_282-b08
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-client.txt
Max. process+thread count 64 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4626/1/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@Apache9 Apache9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just skimmed a small piece of code.

For the returns only warning, let me think whether we could implement spotless rule to convert it automatically, so we do not need to mix this stytle change with other more critical fixes.

@@ -28,7 +29,7 @@ public final class CacheEvictionStats {

private final long evictedBlocks;
private final long maxCacheSize;
private final Map<byte[], Throwable> exceptions;
private final IdentityHashMap<byte[], Throwable> exceptions;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will be a bit dangerous if we will return this map to upper layer...

Copy link
Contributor Author

@apurtell apurtell Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning here is the one that suggests maps and identity keys should not be mixed... that if the keys use object identity, the map type should be IdentityHashMap. It seems minor, but correct.

storeFileSizeMB += r.getStoreFileSize().get(Size.Unit.MEGABYTE);
memStoreSizeMB += r.getMemStoreSize().get(Size.Unit.MEGABYTE);
storefileIndexSizeKB += r.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE);
uncompressedStoreFileSizeMB = (long) (uncompressedStoreFileSizeMB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use += and cast the right operator to long is enough?

@apurtell
Copy link
Contributor Author

@Apache9 Agreed, let's apply the new spotless rule for the automated fix, and then come back to this PR.

@apurtell apurtell marked this pull request as draft July 18, 2022 22:39
@apurtell apurtell closed this Jul 22, 2022
@apurtell apurtell deleted the HBASE-27203 branch July 22, 2022 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants